/*
 * wordsearcher.c
 *
 *  Created on: 21.10.2011
 *      Author: David
 */

#include "wavePlayer.h"
#include "integer.h"
#include "typedef.h"
#include "pff.h"
#include "tools.h"
#include <stdlib.h>
#include <string.h>

#define TEMP_MINUS 0b10000000

extern FRESULT play (
		const char *dir,	/* Directory */
		const char *fn		/* File */
	);

/**
 *
 */
void vPlayTemperature(u8 u8Temperature, b8 b8Sign)
{
	FRESULT res;
	char tmp[15] = {'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'};

	if((u8Temperature & TEMP_MINUS) == TEMP_MINUS)
	{
		res = play("wav", "minus.wav");
	}

	itoa(u8Temperature, tmp, 10);
	strcat((char*)tmp, ".wav");

	res = play("wav", tmp);

	res = play("wav", "posts.wav"); //8.3 filename is used. It means max 8 characters for name and 3 for suffix of file
}
